package com.xmh.datasource.demo.controller;

import com.xmh.datasource.demo.entity.ManEntity;
import com.xmh.datasource.demo.service.ManService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/man", produces = "application/json;charset=UTF-8")
@Transactional
@CrossOrigin
@Validated
public class ManController {

    @Autowired
    private ManService manService;

    @GetMapping("/save")
    public List<ManEntity> save() {
        return this.manService.getSomeData();
    }

}
